package br.org.etec.dotcao.ws;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import br.org.etec.dotcao.model.City;
import br.org.etec.dotcao.model.CityRepository;
import br.org.etec.dotcao.model.RepositoryFactory;

@Path("/city")
public class CityResource {
	
	@GET
	@Path("/return/")
	@Produces({MediaType.APPLICATION_JSON})
	public List<City> allCity(){
		return ((CityRepository)RepositoryFactory.get(City.class)).all();
	}
	

	@GET
	@Path("/return/{state}")
	@Produces({MediaType.APPLICATION_JSON})
	public List<City> cityByName(@PathParam("state") long state_param){
		return ((CityRepository)RepositoryFactory.get(City.class)).all(state_param);
	}
	
}
